package com.behelpful.common.integration.iredis.constants;

import lombok.Getter;

/**
 * Redis 自定义锁
 *
 * @author Alay
 * @date 2021-08-17 16:55
 * @project be-helpful
 * @since
 */
@Getter
public enum RedisLockEnum {

    /**
     * 用户注册锁
     */
    REGISTER_LOCK("REGISTER_LOCK", 13, 30),
    ;
    /**
     * 锁key
     */
    private String key;
    /**
     * Redis 库
     */
    private int index;
    /**
     * 过期时间秒
     */
    private int expireSec;
    /**
     * 过期时间毫秒
     */
    private long expireMill;

    RedisLockEnum(String key, int index, int expireSec) {
        this.key = key;
        this.index = index;
        this.expireSec = expireSec;
    }

    RedisLockEnum(String key, int index, long expireMill) {
        this.key = key;
        this.index = index;
        this.expireMill = expireMill;
    }
}
